// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Glass" {
Properties {
 _ReflectValue ("Reflect Value", Range(0,1)) = 0.5
 _MainTex ("Main Texture", 2D) = "white" { }
 _AlphaTex ("Alpha Texture", 2D) = "white" { }
 _CubeTex ("Cubemap Texture", CUBE) = "" { }
}
SubShader { 
 Tags { "QUEUE"="Transparent" }
 Pass {
  Tags { "QUEUE"="Transparent" }
  Cull Off
  Blend SrcAlpha OneMinusSrcAlpha
  ColorMask RGB
  GpuProgramID 48654
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 UNITY_MATRIX_MV;
//uniform float4x4 UNITY_MATRIX_IT_MV;
uniform sampler2D _MainTex;
uniform sampler2D _AlphaTex;
uniform samplerCUBE _CubeTex;
uniform float _ReflectValue;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3x3 tmpvar_1;
    tmpvar_1[0] = conv_mxt4x4_0(UNITY_MATRIX_IT_MV).xyz;
    tmpvar_1[1] = conv_mxt4x4_1(UNITY_MATRIX_IT_MV).xyz;
    tmpvar_1[2] = conv_mxt4x4_2(UNITY_MATRIX_IT_MV).xyz;
    float3 tmpvar_2;
    tmpvar_2 = normalize(mul(tmpvar_1, in_v.normal));
    float3 tmpvar_3;
    tmpvar_3 = UnityObjectToViewPos(in_v.vertex).xyz;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = in_v.texcoord.xy;
    out_v.xlv_TEXCOORD1 = (tmpvar_3 - (2 * (dot(tmpvar_2, tmpvar_3) * tmpvar_2)));
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 tmpvar_1;
    float3 reflColor_2;
    float4 alphaTex_3;
    float4 colorTex_4;
    float4 tmpvar_5;
    tmpvar_5 = tex2D(_MainTex, in_f.xlv_TEXCOORD0);
    colorTex_4 = tmpvar_5;
    float4 tmpvar_6;
    tmpvar_6 = tex2D(_AlphaTex, in_f.xlv_TEXCOORD0);
    alphaTex_3 = tmpvar_6;
    float3 tmpvar_7;
    tmpvar_7 = texCUBE(_CubeTex, in_f.xlv_TEXCOORD1).xyz;
    reflColor_2 = tmpvar_7;
    float4 tmpvar_8;
    tmpvar_8.xyz = lerp(colorTex_4.xyz, reflColor_2, float3(_ReflectValue, _ReflectValue, _ReflectValue));
    tmpvar_8.w = (alphaTex_3.x * colorTex_4.w);
    tmpvar_1 = tmpvar_8;
    out_f.color = tmpvar_1;
    return out_f;
}


ENDCG

}
}
SubShader { 
 Tags { "QUEUE"="Transparent" }
 Pass {
  Tags { "QUEUE"="Transparent" }
  Cull Off
  Blend SrcAlpha OneMinusSrcAlpha
  ColorMask RGB
  GpuProgramID 80141
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
uniform float4 _MainTex_ST;
uniform sampler2D _MainTex;
struct appdata_t
{
    float4 vertex :POSITION;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_COLOR0 :COLOR0;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    float4 tmpvar_2;
    tmpvar_2 = clamp(float4(0, 0, 0, 1.1), 0, 1);
    tmpvar_1 = tmpvar_2;
    float4 tmpvar_3;
    tmpvar_3.w = 1;
    tmpvar_3.xyz = in_v.vertex.xyz;
    out_v.xlv_COLOR0 = tmpvar_1;
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.vertex = UnityObjectToClipPos(tmpvar_3);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 tmpvar_1;
    tmpvar_1 = tex2D(_MainTex, in_f.xlv_TEXCOORD0);
    out_f.color = tmpvar_1;
    return out_f;
}


ENDCG

}
}
}